package com.cdu.ai_intelligent_teaching_and_training_system.mapper;

import com.cdu.ai_intelligent_teaching_and_training_system.entity.Exam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface ExamMapper {
    
    // 插入考试
    int insert(Exam exam);
    
    // 根据ID查询考试
    Exam selectById(@Param("examId") Long examId);
    
    // 根据课程ID查询考试
    List<Exam> selectByCourseId(@Param("courseId") Long courseId);
    
    // 查询所有考试
    List<Exam> selectAll();
    
    // 更新考试
    int update(Exam exam);
    
    // 删除考试
    int deleteById(@Param("examId") Long examId);

    List<Exam> selectByExamDateAfter(LocalDateTime now);

    List<Exam> selectByTitleLike(String s);
}
